Page({
  data: {
    feedbackText: '' 
  },
  inputFeedback: function(e) {
    this.setData({
      feedbackText: e.detail.value  
    });
  },
  submitFeedback: function() {
    const feedback = this.data.feedbackText;  
    wx.request({
      url: '#',//连接服务器
      method: 'POST',
      data: {
        feedback: feedback
      },
      success: function(res) {
        console.log('反馈提交成功');
        wx.showToast({
          title: '提交成功',
          icon: 'success',
					duration: 2000,
					success: function() {
						wx.navigateTo({
							url: '/pages/mine/mine' 
						});
					}
        });
      },
      fail: function(err) {
        console.error('反馈提交失败', err);
        wx.showToast({
          title: '提交失败，请重试',
          icon: 'none',
          duration: 2000
        });
      }
    });
  }
});
